<template>
  <div class="love-album">
    <div class="album-header">
      <h3>我收藏的专辑</h3>
      <div class="album-count">共 {{ albums.length }} 张</div>
    </div>
    <div class="album-grid">
      <div v-for="album in albums" :key="album.id" class="album-item">
        <div class="album-cover">
          <img :src="album.cover" :alt="album.name" />
        </div>
        <div class="album-info">
          <div class="album-name">{{ album.name }}</div>
          <div class="album-artist">{{ album.artist }}</div>
          <div class="album-year">{{ album.year }}</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref, type Ref } from 'vue'

interface Album {
  id: number
  name: string
  artist: string
  year: string
  cover: string
}

const albums: Ref<Album[]> = ref([
  { id: 1, name: '示例专辑1', artist: '示例歌手1', year: '2023', cover: '/placeholder-album.jpg' },
  { id: 2, name: '示例专辑2', artist: '示例歌手2', year: '2022', cover: '/placeholder-album.jpg' },
  { id: 3, name: '示例专辑3', artist: '示例歌手3', year: '2024', cover: '/placeholder-album.jpg' }
])
</script>

<style scoped>
.love-album {
  padding: 20px 0;
}

.album-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #333;
}

.album-header h3 {
  color: #ffffff;
  margin: 0;
  font-size: 18px;
}

.album-count {
  color: #999;
  font-size: 14px;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.album-item {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 15px;
  transition: background-color 0.3s ease;
  cursor: pointer;
}

.album-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.album-cover {
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 10px;
  border-radius: 8px;
  overflow: hidden;
}

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: #333;
}

.album-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.album-name {
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
}

.album-artist {
  color: #999;
  font-size: 14px;
}

.album-year {
  color: #666;
  font-size: 12px;
}
</style>